<template>
    <div class="header">
        <div class="logo">{{this.$store.state.grogshop.grogshopName}}</div>
        <div class="el-dropdown-link" @click='delCookie("data")'>
            退出登陆
        </div>
    </div>
</template>

<script>
export default {
    data() {
        return {
            name: this.$store.state.login.username
        }
    },
    mounted() {
    },
    methods: {
        delCookie(name) {
            var myDate = new Date();
            myDate.setTime(-1000);//设置时间    
            document.cookie = name + "=''; expires=" + myDate.toGMTString();
            this.$router.push('/login');
        }
    }
}
</script>

<style>
.header {
    width: 100%;
    height: 70px;
    background: #242f42;
    font-size: 22px;
    line-height: 70px;
    color: #fff;
    position: relative;
    box-sizing: border-box;
}

.logo {
    float: left;
    width: 250px;
    text-align: center;
}

.el-dropdown-link {
    position: relative;
    display: inline-block;
    padding-right: 70px;
    color: #fff;
    cursor: pointer;
    vertical-align: middle;
    float: right;
    font-size: 16px;
}
</style>